
package com.hc.dao.impl;

import org.springframework.stereotype.Repository;

import com.hc.dao.IRoleAndNodesDao;
import com.hc.domain.Nodes;
import com.hc.domain.RoleAndNodes;
@Repository
public class RoleAndNodesDaoImpl extends BaseDaoImpl<RoleAndNodes> implements IRoleAndNodesDao {

	@Override
	public void deleteRoleAndNodes(Nodes node) {
		super.executeHql("DELETE FROM RoleAndNodes r WHERE r.nodeId=?", new Object[]{node.getId()});
	}

	@Override
	public RoleAndNodes getRoleAndNodeByRoleIdAndNodeId(int roleId, int nodeId) {
		return super.get("FROM RoleAndNodes r WHERE r.roleId=? AND r.nodeId=?", new Object[]{roleId,nodeId});
	}

	@Override
	public void updateOrSave(RoleAndNodes rn) {
		super.saveOrUpdate(rn);
	}

	@Override
	public void deleteRoleAndNodes(RoleAndNodes rn) {
		super.delete(rn);
	}

}

